<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>cdfgam</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : Dec 1997</div>
    <p>
      <b>cdfgam</b> -  cumulative distribution function gamma distribution</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[P,Q]=cdfgam("PQ",X,Shape,Scale)  </tt>
      </dd>
      <dd>
        <tt>[X]=cdfgam("X",Shape,Scale,P,Q)  </tt>
      </dd>
      <dd>
        <tt>[Shape]=cdfgam("Shape",Scale,P,Q,X)  </tt>
      </dd>
      <dd>
        <tt>[Scale]=cdfgam("Scale",P,Q,X,Shape)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>P,Q,X,Shape,Scale</b>
        </tt>: five real vectors of the same size.</li>
      <li>
        <tt>
          <b>P,Q (Q=1-P)  </b>
        </tt>The integral from 0 to X of the gamma density. Input range: [0,1].</li>
      <li>
        <tt>
          <b>X</b>
        </tt>:  The upper limit of integration of the gamma density. Input range: [0, +infinity). Search range: [0,1E300]</li>
      <li>
        <tt>
          <b>Shape</b>
        </tt>:  The shape parameter of the gamma density. Input range: (0, +infinity). Search range: [1E-300,1E300]</li>
      <li>
        <tt>
          <b>Scale</b>
        </tt>:  The scale parameter of the gamma density. Input range: (0, +infinity). Search range: (1E-300,1E300]</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    Calculates any one parameter of the gamma
    distribution given values for the others.</p>
    <p>
    Cumulative distribution function (P) is calculated directly by
    the code associated with:</p>
    <p>
    DiDinato, A. R. and Morris, A. H. Computation of the  incomplete
    gamma function  ratios  and their  inverse.   ACM  Trans.  Math.
    Softw. 12 (1986), 377-393.</p>
    <p>
    Computation of other parameters involve a seach for a value that
    produces  the desired  value  of P.   The search relies  on  the
    monotinicity of P with the other parameter.</p>
    <p>
    The gamma density is proportional to
    <tt>
        <b>T**(SHAPE - 1) * EXP(- SCALE * T)</b>
      </tt>
    </p>
    <p>
    From DCDFLIB: Library of Fortran Routines for Cumulative Distribution
    Functions, Inverses, and Other Parameters (February, 1994)
    Barry W. Brown, James Lovato and Kathy Russell. The University of
    Texas.</p>
  </body>
</html>
